/*
 * charset.c
 *
 * Conversion tables and routines to support different character sets.
 * The PGP internal format is latin-1.
 *
 * (c) Copyright 1990-1996 by Philip Zimmermann.  All rights reserved.
 * The author assumes no liability for damages resulting from the use
 * of this software, even if the damage results from defects in this
 * software.  No warranty is expressed or implied.
 *
 * Code that has been incorporated into PGP from other sources was
 * either originally published in the public domain or is used with
 * permission from the various authors.
 *
 * PGP is available for free to the public under certain restrictions.
 * See the PGP User's Guide (included in the release package) for
 * important information about licensing, patent restrictions on
 * certain algorithms, trademarks, copyrights, and export controls.
 */

#include <ctype.h>

/*
 * to_upper() and to_lower(), replacement for toupper() and tolower(),
 * calling to_upper() on uppercase or to_lower on lowercase characters
 * is handled correctly.
 * 
 * XXX: should handle local characterset when 8-bit userID's are allowed
 */
int
to_upper(int c)
{
		c &= 0xFF;
		if (islower(c))
				return (toupper(c));
		return c;
}

int
to_lower(int c)
{
		c &= 0xFF;
		if (isupper(c))
				return (tolower(c));
		return c;
}
